//登录验证
function login(){
    let tid=$("#tid").val();
    let tpsw=$("#tpsw").val();
    let tuser=JSON.parse(localStorage.getItem("key"));
    // console.log(tuser)
    //可以拿到值
    // console.log(tid+tpsw);
    //将tuser循环

    for(let i=0;i<tuser.length;i++){
        if(tid!="" || tpsw!=""){
            if(tid==tuser[i].id && tpsw==tuser[i].password){
                let teaid={
                    "id":tid
                }
                let tId=Array();
                tId.push(teaid);
                let Id=JSON.stringify(tId);
                alert(Id)
                localStorage.setItem("tId",Id);
                $(location).attr("href","../../index.html");
                break;
            }else if(i==tuser.length-1){
                console.log()
                alert("该员工不存在或输入密码错误！");
                break;
            }
        }else{
            alert("员工ID或密码不能为空！");
            break;
        }
    }
}